<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Page
 *
 * @author wanghao
 */
abstract class _Page {

    function run() {
        try {
            //用户信息
            $this->getUserInfo();

            //基本权限验证
            $this->checkAuth();

            //获取参数
            $this->getPara();

            //校验参数
            $this->checkPara();

            //主函数
            $this->pageLoad();

            //输出 http 头信息
            $this->outputHttp();

            //输出页面
            $this->outputPage();
            
        } catch (Exception $ex) {
            $this->showError($ex);
        }
    }

    protected function getUserInfo() {
        
    }

    protected function checkAuth() {
        
    }

    protected function getPara() {
        
    }

    protected function checkPara() {
        
    }

    protected function pageLoad() {
        
    }

    protected function outputHttp() {
        
    }

    protected function outputPage() {
        //输出页面标准头部
        $this->outputHead();

        //输出页面主体部分
        $this->outputBody();

        //输出页面标准尾部
        $this->outputTail();
    }

    protected function outputHead() {
        
    }

    protected function outputBody() {
        
    }

    protected function outputTail() {
        
    }

    protected function showError($ex) {
        
    }

}

?>
